
// ypControllerDlg.h : header file
//

#pragma once

#include "func_btn.h"
#include "Resource.h"

typedef const std::string& con_str_ref;

// CypControllerDlg dialog
class CypControllerDlg : public CDialogEx
{
// Construction
public:
	CypControllerDlg(CWnd* pParent = NULL);	// standard constructor
    ~CypControllerDlg();

// Dialog Data
	enum { IDD = IDD_YPCONTROLLER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

public:
	void switch_page(std::string new_page_name);


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnClose();
	DECLARE_MESSAGE_MAP()

protected:
    typedef std::vector<func_btn *> vBtnPtrs;

protected:
    void create_all_btns();
	func_image_btn* create_image_btn(const button &btn_info, CRect rect);
	func_text_btn* create_text_btn(const button &btn_info, CRect rect);
    void show_page(con_str_ref page_name);
	void hide_cur_page();
    void show_btns(vBtnPtrs& btn_ptrs);
	void hide_btns(vBtnPtrs& btn_ptrs);
	void draw_bkg();
	bool file_exist(con_str_ref path);

private:
    std::map<std::string, vBtnPtrs> m_PageMap;
    UINT m_BtnID;
    std::string m_curPageName;
    CImage m_BkgPic;
};
